//博客前台首页的展示页面
//导入分页模块
const pagination = require('mongoose-sex-page');
const { Article } = require('../../model/article');
module.exports = async(req, res) => {
    const page = req.query.page;
    let result = JSON.parse(JSON.stringify(await pagination(Article).find().populate('author').page(page).size(4).display(5).exec()));
    res.render('home/default', {
        result: result
    });
}